import matplotlib.pyplot as plt                                             # 调用 matplotlib
import numpy as np

nsteps = 20000 #20000 = 1000 * 20
draws = np.random.randint(-10,11,size=(2,nsteps))
walks = draws.cumsum(1)  #cumsum 函数是将每次的移动累加，最后通过 plot 画出来
plt.plot(walks[0,:],walks[1,:])
plt.show()